/* 系统验证 */
var x = typeof $ === "function" ? window.$ : {};
//验证

(function ($) {
  $.extend($.validator.messages, {
    required: "必填信息",
    remote: "请修正该信息",
    email: "请输入正确格式的电子邮件",
    url: "请输入合法的网址",
    date: "请输入合法的日期",
    dateISO: "请输入合法的日期 (YYYY-MM-DD).",
    number: "请输入合法的数值",
    digits: "请输入一个正整数",
    equalTo: "请再次输入相同的值",
    maxlength: $.validator.format("最多可以输入 {0} 个字符"),
    minlength: $.validator.format("最少要输入 {0} 个字符"),
    rangelength: $.validator.format("请输入长度在 {0} 到 {1} 之间的字符串"),
    range: $.validator.format("请输入范围在 {0} 到 {1} 之间的数值"),
    max: $.validator.format("请输入不大于 {0} 的数值"),
    min: $.validator.format("请输入不小于 {0} 的数值"),
    errorMessage: "您填写的信息有误，请根据提示修正。",
    checkName: "不可输入!@#$%^&<>?这类字符",
    userName: "账户为6-30位英文字母、数字符号组合,请勿输入特殊字符",
    userPwd: "密码为6-30位数字、字母或符号的组合",
    userPwdAll: "密码为6-30位数字、字母、符号3种的组合",
    realName: "姓名只能为2-30个汉字",
    abc: "请输入字母数字或下划线",
    noEqualTo: "请再次输入不同的值",
    mobile: "请正确填写11位的手机号码",
    simplePhone: "请正确填写您的电话号码，固话为区号(3-4位)号码(7-9位)",
    phone: "请正确填写您的电话号码，固话为区号(3-4位)号码(7-9位),手机为13,14,15,16,17,18,19号段",
    zipCode: "请正确填写您的邮政编码",
    integer: "请输入一个整数",
    ipv4: "请输入一个有效的 IP v4 地址",
    ipv6: "请输入一个有效的 IP v6 地址",
    qq: "请正确填写您的QQ号码",
    idcard: "请输入正确的身份证号码(15-18位)",
    sum: "只能输入1位小数",
    sum2: "只能输入2位小数",
    sum3: "只能输入3位小数",
    sum4: "只能输入4位小数",
    sum8: "只能输入8位小数",
    zeroInt: "输入0和正整数",
    zeroSum: "格式错误",
    int: "输入正整数",
    negInt: "输入0和负整数",
    intAll: "输入0和正/负整数",
    tel: "输入正确手机号码",
    mail: "输入正确邮箱地址",
    phone: "电话号码错误,正确格式例如0755-12345678",
    telPhone: "联系电话错误,类似0755-12345678或18612345678",
    postCode: "邮政编码错误",
    idcardSimple: "身份证号码错误",
    chineseWord: "请输入中文",
    englishWord: "请输入英文",
    specialWord: "请输入英文特殊字符",
    enNum: "请输入英文数字",
    chEnNum: "请输入中英文数字",
    bankCard: "请输入正确的银行卡号",
    str: "请输入中文字、英文字母、数字和下划线",
    carNo: "请输入正确的车牌号",
    notEqualTo: $.validator.format("不能输入{0}"),
    requiredOne: "两项必须填写一项",
    requiredTo: "指定元素为不为空则此元素也为必填",
    notEquals: $.validator.format("不能输入{0}"),
    lessThan: "此元素必须小于等于指定元素!",
    ymdDate: "请输入正确的日期(YYMM-MM-DD或者YYYY/MM/DD)",
    hmTime: "请输入一个正确的时间,在00:00 - 23:59之间",
    compareInt: "请输入正确数字区间",
    prefix: $.validator.format("请输入以{0}开头的字符串!"),
    byteMaxLength: $.validator.format("不能超过{0}个字节(一个中文字算2个字节)"),
    byteMinLength: $.validator.format("不能少于{0}个字节(一个中文字算2个字节)"),
    byteRangeLength: $.validator.format("请确保输入的值在{0}-{1}个字节之间(一个中文字算2个字节)"),
    filt: "不能填写过敏词",
    space: "不能填写过敏词",
  })
}(jQuery));

(function ($) {
  $("#form-ajax .panel-footer").append('<div class="form-error">' + $.validator.messages.errorMessage + "</div>");
  $.extend($.validator.defaults, {
    ignore: "",
    errorClass: "validator-tip",
    errorContainer: ".form-error",
    errorPlacement: function (error, element) {
      if (error.closest(".checkbox").size() > 0) {
        element = element.closest(".checkbox");
        element.parent().css("position", "relative");
        error.insertAfter(element);
        error.css({
          top: element.position().top + element.outerHeight() + 10,
          left: element.position().left
        });
        return
      }

      if (error.closest(".selectpicker").size() > 0) {
        element = element.closest(".selectpicker");
        element.parent().css("position", "relative");
        error.insertAfter(element);
        error.css({
          top: element.position().top + element.outerHeight() + 2,
          left: element.position().left + 5
        });
        return
      }
      if (element.next().hasClass("select2")) {
        element = element.next();
        element.parent().css("position", "relative")
      } else {
        if (element.closest(".input-group").length > 0) {
          element = element.closest(".input-group");
          element.parent().css("position", "relative")
        }
      }
      error.insertAfter(element);
      error.css({
        top: element.position().top + element.outerHeight(),
        left: element.position().left
      })
    },
    highlight: function (error) {
      $(error).closest(".form-group").addClass("has-error")
    },
    unhighlight: function (error) {
      $(error).closest(".form-group").removeClass("has-error")
    },
    success: function (error) {
      $(error).remove()
    }
  })
}(jQuery));


x.regEx = {
  Strs: /^[\u0391-\uFFE5\w]+$/, //中文字、英文字母、数字和下划线
  NumEn: /^[_a-z0-9]+$/, //检查数字英文
  ZeroInt: /^(0|\+?[1-9][0-9]*)$/, //检查0正整数
  zeroSum: /^[+-]?\d*\.?\d{0,3}$/,
  NoneZeroInt: /^[0-9]*[1-9][0-9]*$/, //非0正整数
  Int6: /^\d{6}$/, //检查6位数字
  QQ: /^[1-9]\d{4,10}$/, //检查QQ
  Amount: /^(0\.\d{1,2}|[1-9]\d{0,8}(\.\d{1,2})?)$/, //检查金额数字 0.00 和 小数的后两位
  Sum: /^(\d+\.\d{1,1}|\d+)$/, //检查金额数字 0.0 和 小数的后一位
  Tons: /^(0\.\d{1,3}|[1-9]\d{0,8}(\.\d{1,3})?)$/, //检查金额数字 0.000 和 小数的后三位
  Tons4: /^(0\.\d{1,4}|[1-9]\d{0,8}(\.\d{1,4})?)$/, //检查金额数字 0.0000 和 小数的后三位
  Tons8: /^(0\.\d{1,8}|[1-9]\d{0,8}(\.\d{1,8})?)$/, //检查金额数字 0.0000 和 小数的后三位
  //Tel:/^(0|86|17951)?(13[0-9]|15[012356789]|17[678]|18[0-9]|14[57])[0-9]{8}$/,//更新最新手机验证
  Tel: /^[1|9]\d{10}$/, //放开手机格式验证，1,9开头的11位数字即可
  Mobile: /^((\d{11})|^((\d{7,8})|(\d{4}|\d{3})-(\d{7,8})|(\d{4}|\d{3})-(\d{7,8})-(\d{4}|\d{3}|\d{2}|\d{1})|(\d{7,8})-(\d{4}|\d{3}|\d{2}|\d{1}))$)$/, //检查固定电话 //0471-1234567
  PostCode: /^[1-9]\d{5}(?!\d)$/, //检查中国邮政编码
  Email: /^((([a-zA-Z]|\d|[!#\$%&'\*\+\-\/=\?\^_`{\|}~]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])+(\.([a-zA-Z]|\d|[!#\$%&'\*\+\-\/=\?\^_`{\|}~]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])+)*)|((\x22)((((\x20|\x09)*(\x0d\x0a))?(\x20|\x09)+)?(([\x01-\x08\x0b\x0c\x0e-\x1f\x7f]|\x21|[\x23-\x5b]|[\x5d-\x7e]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(\\([\x01-\x09\x0b\x0c\x0d-\x7f]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]))))*(((\x20|\x09)*(\x0d\x0a))?(\x20|\x09)+)?(\x22)))@((([a-zA-Z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-zA-Z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-zA-Z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-zA-Z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.)+(([a-zA-Z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-zA-Z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-zA-Z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-zA-Z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.?$/, //检查电子邮件
  ChineseWord: /^[\u4e00-\u9fa5]+$/, //检查汉字
  EnglishWord: /^[a-zA-Z]+$/, //检查英文
  //SpecialWord:/^[\`\=\,\/\;\'\[\]\~\!\@\#\$\%\^\&\*\(\)\+\{\}\|\:"\<\>\?]+$/,//检查特殊字符
  SpecialWord: /^[`\\~\!\@\#\$\%\^\&\*\(\)\_\+\{\}\|\:\"\<\>\?\/\.\,\;\'\[\]\\]+$/, //检查特殊字符
  CardId: /^(\d{6})(18|19|20)?(\d{2})([01]\d)([0123]\d)(\d{3})(\d|X|x)?$/, //简单检查身份证方法
  CardNum: /^[1-9]\d{14,18}$/, //检查一般卡号 15位-19位
  CardCompany: /^[\u4e00-\u9fa5a-zA-Z0-9]+$/, //检查 卡号开户行 中英文数字
  ChineseEnNum: /^[\u4e00-\u9fa5a-zA-Z0-9]+$/, //检查中文和英文 数字
  SpecialName: /^[!\@\#\$\%\^\&\<\>\?\\]+$/,
  Time: /^(?:(?!0000)[0-9]{4}-(?:(?:0[1-9]|1[0-2])-(?:0[1-9]|1[0-9]|2[0-8])|(?:0[13-9]|1[0-2])-(?:29|30)|(?:0[13578]|1[02])-31)|(?:[0-9]{2}(?:0[48]|[2468][048]|[13579][26])|(?:0[48]|[2468][048]|[13579][26])00)-02-29)$/ //检查时间格式YYYY-MM-DD
};


/**
    ----- 真实姓名 姓名只能为2-30个汉字 -----
**/
jQuery.validator.addMethod("realName", function (b, a) {
  return this.optional(a) || /^[\u4e00-\u9fa5]{2,30}$/.test(b)
}, $.validator.messages.realName);
/**
    ----- abc 请输入字母数字或下划线 -----
**/
jQuery.validator.addMethod("abc", function (b, a) {
  return this.optional(a) || /^[a-zA-Z0-9_]*$/.test(b)
}, $.validator.messages.abc);
/**
    ----- noEqualTo 请再次输入不同的值 -----
**/
jQuery.validator.addMethod("noEqualTo", function (b, a, c) {
  return b != $(c).val()
}, $.validator.messages.noEqualTo);

/**
    ----- 手机号 只能是13,14,15,17,18号段 -----
**/
jQuery.validator.addMethod("mobile", function (c, b) {
  var a = /^[1|9][3,4,5,6,7,8,9]\d{9}$/g;
  return this.optional(b) || (a.test(c))
}, $.validator.messages.mobile);

/**
    ----- 固话为区号(3-4位)号码(7-9位)-----
**/
jQuery.validator.addMethod("simplePhone", function (c, b) {
  var a = /^(\d{3,4}-?)?\d{7,9}$/g;
  return this.optional(b) || (a.test(c))
}, $.validator.messages.simplePhone);

/**
    ----- 固话为区号(3-4位)号码(7-9位),手机为13,14,15,17,18号段-----
**/
jQuery.validator.addMethod("phone", function (c, b) {
  var a = /(^0[1-9]{1}\d{8,10}$)|(^1[3,4,5,6,7,8,9]\d{9}$)/g;
  return this.optional(b) || (a.test(c))
}, $.validator.messages.phone);

/**
    ----- 邮政编码-----
**/
jQuery.validator.addMethod("zipCode", function (c, b) {
  var a = /^[0-9]{6}$/;
  return this.optional(b) || (a.test(c))
}, $.validator.messages.zipCode);

/**
    ----- 验证整数 -----
**/
$.validator.addMethod("integer", function (b, a) {
  return this.optional(a) || /^-?\d+$/.test(b)
}, $.validator.messages.integer);


/**
    ----- 验证ip4 -----
**/
$.validator.addMethod("ipv4", function (b, a) {
  return this.optional(a) || /^(25[0-5]|2[0-4]\d|[01]?\d\d?)\.(25[0-5]|2[0-4]\d|[01]?\d\d?)\.(25[0-5]|2[0-4]\d|[01]?\d\d?)\.(25[0-5]|2[0-4]\d|[01]?\d\d?)$/i.test(b)
}, $.validator.messages.ipv4);


/**
    ----- 验证IP6 -----
**/
$.validator.addMethod("ipv6", function (b, a) {
  return this.optional(a) || /^((([0-9A-Fa-f]{1,4}:){7}[0-9A-Fa-f]{1,4})|(([0-9A-Fa-f]{1,4}:){6}:[0-9A-Fa-f]{1,4})|(([0-9A-Fa-f]{1,4}:){5}:([0-9A-Fa-f]{1,4}:)?[0-9A-Fa-f]{1,4})|(([0-9A-Fa-f]{1,4}:){4}:([0-9A-Fa-f]{1,4}:){0,2}[0-9A-Fa-f]{1,4})|(([0-9A-Fa-f]{1,4}:){3}:([0-9A-Fa-f]{1,4}:){0,3}[0-9A-Fa-f]{1,4})|(([0-9A-Fa-f]{1,4}:){2}:([0-9A-Fa-f]{1,4}:){0,4}[0-9A-Fa-f]{1,4})|(([0-9A-Fa-f]{1,4}:){6}((\b((25[0-5])|(1\d{2})|(2[0-4]\d)|(\d{1,2}))\b)\.){3}(\b((25[0-5])|(1\d{2})|(2[0-4]\d)|(\d{1,2}))\b))|(([0-9A-Fa-f]{1,4}:){0,5}:((\b((25[0-5])|(1\d{2})|(2[0-4]\d)|(\d{1,2}))\b)\.){3}(\b((25[0-5])|(1\d{2})|(2[0-4]\d)|(\d{1,2}))\b))|(::([0-9A-Fa-f]{1,4}:){0,5}((\b((25[0-5])|(1\d{2})|(2[0-4]\d)|(\d{1,2}))\b)\.){3}(\b((25[0-5])|(1\d{2})|(2[0-4]\d)|(\d{1,2}))\b))|([0-9A-Fa-f]{1,4}::([0-9A-Fa-f]{1,4}:){0,5}[0-9A-Fa-f]{1,4})|(::([0-9A-Fa-f]{1,4}:){0,6}[0-9A-Fa-f]{1,4})|(([0-9A-Fa-f]{1,4}:){1,7}:))$/i.test(b)
}, $.validator.messages.ipv6);


/**
    ----- 验证 qq -----
**/
jQuery.validator.addMethod("qq", function (c, b) {
  var a = /^[1-9][0-9]{4,}$/;
  return this.optional(b) || (a.test(c))
}, $.validator.messages.qq);


/**
    ----- 验证身份证号码 -----
**/
jQuery.validator.addMethod("idcard", function (b, a) {
  var c = function (g) {
    g = g.toString();
    var i = new Array(true, false, false, false, false);
    var h = {
      11: "北京",
      12: "天津",
      13: "河北",
      14: "山西",
      15: "内蒙古",
      21: "辽宁",
      22: "吉林",
      23: "黑龙江",
      31: "上海",
      32: "江苏",
      33: "浙江",
      34: "安徽",
      35: "福建",
      36: "江西",
      37: "山东",
      41: "河南",
      42: "湖北",
      43: "湖南",
      44: "广东",
      45: "广西",
      46: "海南",
      50: "重庆",
      51: "四川",
      52: "贵州",
      53: "云南",
      54: "西藏",
      61: "陕西",
      62: "甘肃",
      63: "青海",
      64: "宁夏",
      65: "新疆",
      71: "台湾",
      81: "香港",
      82: "澳门",
      91: "国外"
    };
    var g, j, e, ereg;
    var f, k;
    var d = new Array();
    d = g.split("");
    if (h[parseInt(g.substr(0, 2))] == null) {
      return i[4]
    }
    switch (g.length) {
      case 15:
        if ((parseInt(g.substr(6, 2)) + 1900) % 4 == 0 || ((parseInt(g.substr(6, 2)) + 1900) % 100 == 0 && (parseInt(g.substr(6, 2)) + 1900) % 4 == 0)) {
          var ereg = /^[1-9][0-9]{5}[0-9]{2}((01|03|05|07|08|10|12)(0[1-9]|[1-2][0-9]|3[0-1])|(04|06|09|11)(0[1-9]|[1-2][0-9]|30)|02(0[1-9]|[1-2][0-9]))[0-9]{3}$/
        } else {
          var ereg = /^[1-9][0-9]{5}[0-9]{2}((01|03|05|07|08|10|12)(0[1-9]|[1-2][0-9]|3[0-1])|(04|06|09|11)(0[1-9]|[1-2][0-9]|30)|02(0[1-9]|1[0-9]|2[0-8]))[0-9]{3}$/
        }
        if (ereg.test(g)) {
          return i[0]
        } else {
          return i[2]
        }
        break;
      case 18:
        if (parseInt(g.substr(6, 4)) % 4 == 0 || (parseInt(g.substr(6, 4)) % 100 == 0 && parseInt(g.substr(6, 4)) % 4 == 0)) {
          var ereg = /^[1-9][0-9]{5}19[0-9]{2}((01|03|05|07|08|10|12)(0[1-9]|[1-2][0-9]|3[0-1])|(04|06|09|11)(0[1-9]|[1-2][0-9]|30)|02(0[1-9]|[1-2][0-9]))[0-9]{3}[0-9Xx]$/
        } else {
          var ereg = /^[1-9][0-9]{5}19[0-9]{2}((01|03|05|07|08|10|12)(0[1-9]|[1-2][0-9]|3[0-1])|(04|06|09|11)(0[1-9]|[1-2][0-9]|30)|02(0[1-9]|1[0-9]|2[0-8]))[0-9]{3}[0-9Xx]$/
        }
        if (ereg.test(g)) {
          f = (parseInt(d[0]) + parseInt(d[10])) * 7 + (parseInt(d[1]) + parseInt(d[11])) * 9 + (parseInt(d[2]) + parseInt(d[12])) * 10 + (parseInt(d[3]) + parseInt(d[13])) * 5 + (parseInt(d[4]) + parseInt(d[14])) * 8 + (parseInt(d[5]) + parseInt(d[15])) * 4 + (parseInt(d[6]) + parseInt(d[16])) * 2 + parseInt(d[7]) * 1 + parseInt(d[8]) * 6 + parseInt(d[9]) * 3;
          j = f % 11;
          k = "F";
          e = "10X98765432";
          k = e.substr(j, 1);
          if (k == d[17]) {
            return i[0]
          } else {
            return i[3]
          }
        } else {
          return i[2]
        }
        break;
      default:
        return i[1];
        break
    }
  };
  return this.optional(a) || c(b)
}, $.validator.messages.idcard);

/**
    ----------------------------------- 账户检查 -------------------------------------------
**/
//账户 6-30位数字、字母和下划线组合,请勿输入特殊字符
jQuery.validator.addMethod(
  "userName",
  function (value, element) {
    return this.optional(element) || x.chkUserName(value);
  },
  $.validator.messages.userName
);
//检查账户
x.chkUserName = function (s) {
  if (x.isUserName(s)) {
    return true;
  } else {
    return false;
  }
};
//检查账户名 6-30位英文字母、数字符号的登录账户
x.isUserName = function (s) {
  var reg = /^[a-zA-Z0-9_.@-]+$/;
  var onlyspc = /^[\`\=\,\/\;\'\[\]\~\!\@\#\$\%\^\&\*\(\)\+\{\}\|\:"\<\>\?]+$/;
  if (onlyspc.test(s)) {
    return false;
  }
  if (s.length < 6 || s.length > 30) {
    return false;
  } else if (reg.test(s)) {
    return true;
  } else {
    return false;
  }
};
/**
    ----------------------------------- 密码检查 -------------------------------------------
**/
//密码 6-30位英文字母、数字或者符号至少2种的组合的登录密码
jQuery.validator.addMethod(
  "userPwd",
  function (value, element) {
    return this.optional(element) || x.chkUserPassword(value);
  },
  $.validator.messages.userPwd
);
//检查密码
x.chkUserPassword = function (s) {
  if (x.isUserPassword(s)) {
    return true;
  } else {
    return false;
  }
};
//检查密码 6-30位英文字母、数字或者符号至少2种的组合的登录密码
x.isUserPassword = function (s) {
  var reg = /^[\a-\z\A-\Z0-9\`\-\=\,\.\/\;\'\[\]\\~\!\@\#\$\%\^\&\*\(\)\_\+\{\}\|\:\"\<\>\?\\\@\.]+$/;
  var onlyabc = /^[A-Za-z]+$/;
  var onlynum = /^[0-9]+$/;
  var onlyspc = /^[\`\-\=\,\.\/\;\'\[\]\~\!\@\#\$\%\^\&\*\(\)\_\+\{\}\|\:"\<\>\?\@]+$/;
  if (onlynum.test(s)) {
    return false;
  }
  if (onlyabc.test(s)) {
    return false;
  }
  if (onlyspc.test(s)) {
    return false;
  }
  if (s.length < 6 || s.length > 30) {
    return false;
  } else if (reg.test(s)) {
    return true;
  } else {
    return false;
  }
};

/**
    ----------------------------------- 密码检查2 -------------------------------------------
**/
//密码 6-30位英文字母、数字、者符号3种的组合的登录密码
jQuery.validator.addMethod(
  "userPwdAll",
  function (value, element) {
    return this.optional(element) || x.chkUserPasswordAll(value);
  },
  $.validator.messages.userPwdAll
);
//检查密码
x.chkUserPasswordAll = function (s) {
  if (x.isUserPasswordAll(s)) {
    return true;
  } else {
    return false;
  }
};
//检查密码 6-30位英文字母、数字、符号3种的组合的登录密码
x.isUserPasswordAll = function (s) {
  var reg = /(?=.*[\d]+)(?=.*[a-zA-Z]+)(?=.*[^a-zA-Z0-9]+).{6,30}$/;
  if (s.length < 6 || s.length > 30) {
    return false;
  } else if (reg.test(s)) {
    return true;
  } else {
    return false;
  }
};

//添加验证姓名方法
jQuery.validator.addMethod(
  "checkName",
  function (value, element) {
    return this.optional(element) || x.checkName(value);
  },
  $.validator.messages.checkName
);
//检查账户
x.checkName = function (s) {
  reg = new RegExp("[`!@#$%^&<>?]+");
  if (!reg.test(s)) {
    return true;
  } else {
    return false;
  }
};

/**
    ----------------------------------- 金额数字,1位小数点 -------------------------------------------
**/
//金额数字,1位小数点
jQuery.validator.addMethod(
  "sum1",
  function (value, element) {
    return this.optional(element) || x.chkSum(value);
  },
  $.validator.messages.sum
);
//检查金额数字 0.0 和 小数的后1位
x.chkSum = function (s) {
  if (x.regEx.Sum.test(s) && s != 0.0) {
    return true;
  } else {
    return false;
  }
};

/**
    ----------------------------------- 金额数字,2位小数点 -------------------------------------------
**/
//金额数字,2位小数点
jQuery.validator.addMethod(
  "sum2",
  function (value, element) {
    return this.optional(element) || x.chkAmount(value);
  },
  $.validator.messages.sum2
);
//检查金额数字 0.00 和 小数的后2位
x.chkAmount = function (s) {
  if (x.regEx.Amount.test(s) || parseFloat(s) == 0) {
    return true;
  } else {
    return false;
  }
};

/**
    ----------------------------------- 吨数  金额数字 3位小数点-------------------------------------------
**/
//吨数 (金额数字 3位小数点)
jQuery.validator.addMethod(
  "sum3",
  function (value, element) {
    return this.optional(element) || x.chkTons(value);
  },
  $.validator.messages.sum3
);
//检查金额数字 0.00 和 小数的后两位
x.chkTons = function (s) {
  if (x.regEx.Tons.test(s) || parseFloat(s) == 0) {
    return true;
  } else {
    return false;
  }
};

/**
----------------------------------- 吨数  金额数字 4、8位小数点-------------------------------------------
**/
//吨数 (金额数字 4位小数点)
jQuery.validator.addMethod(
	"sum4",
	function (value, element) {
	return this.optional(element) || x.chkTons4(value);
	},
	$.validator.messages.sum4
);
//检查金额数字 0.00 和 小数的后两位
x.chkTons4 = function (s) {
	if (x.regEx.Tons4.test(s) || parseFloat(s) == 0) {
	return true;
	} else {
	return false;
	}
};

jQuery.validator.addMethod(
	"sum8",
	function (value, element) {
	return this.optional(element) || x.chkTons8(value);
	},
	$.validator.messages.sum8
);
//检查金额数字 0.00 和 小数的后两位
x.chkTons8 = function (s) {
	if (x.regEx.Tons8.test(s) || parseFloat(s) == 0) {
	return true;
	} else {
	return false;
	}
};

/**
    ----------------------------------- 0正整数 -------------------------------------------
**/
//0正整数
jQuery.validator.addMethod(
  "zeroInt",
  function (value, element) {
    return this.optional(element) || x.chkZeroInt(value);
  },
  $.validator.messages.zeroInt
);
//检查输入0正整数
x.chkZeroInt = function (s) {
  if (x.regEx.ZeroInt.test(s)) {
    return true;
  } else {
    return false;
  }
};
/**
    ----------------------------------- 非0 正整数 -------------------------------------------
**/
//非0正整数
jQuery.validator.addMethod(
  "int",
  function (value, element) {
    return this.optional(element) || x.chkNoneZeroInt(value);
  },
  $.validator.messages.int
);
//检查输入非0正整数
x.chkNoneZeroInt = function (s) {
  if (x.regEx.NoneZeroInt.test(s) && s != 0.0) {
    return true;
  } else {
    return false;
  }
};

/**
    ----------------------------------- 0负整数 -------------------------------------------
**/
//0正负整数
jQuery.validator.addMethod(
  "negInt",
  function (value, element) {
    return this.optional(element) || x.chkZeroFNum(value);
  },
  $.validator.messages.negInt
);
//检查0负整数
x.chkZeroFNum = function (s) {
  var onlNumF = /^-[1-9]{1}[0-9]*$/;
  var onlNumZero = /^[0]*$/;
  if (onlNumF.test(s)) {
    return true;
  }
  if (onlNumZero.test(s)) {
    return true;
  }
};

/**
    ----------------------------------- 0正负整数 -------------------------------------------
**/
//0正负整数
jQuery.validator.addMethod(
  "intAll",
  function (value, element) {
    return this.optional(element) || x.chkZeroZFNum(value);
  },
  $.validator.messages.intAll
);
//检查0正负整数
x.chkZeroZFNum = function (s) {
  var onlNumZ = /^[1-9]{1}[0-9]*$/;
  var onlNumF = /^-[1-9]{1}[0-9]*$/;
  var onlNumZero = /^[0]*$/;
  if (onlNumZ.test(s)) {
    return true;
  }
  if (onlNumF.test(s)) {
    return true;
  }
  if (onlNumZero.test(s)) {
    return true;
  }
};

/**
----------------------------------- 0，3位正负数 -------------------------------------------
**/
//0正整数
jQuery.validator.addMethod(
  "zeroSum",
  function (value, element) {
    return x.chkZeroSum(value);
  },
  $.validator.messages.zeroSum
);
x.chkZeroSum = function (s) {
  var reg = /(^([-]?)[1-9]([0-9]+)?(\.[0-9]{1,3})?$)|(^([-]?)(0){1}$)|(^([-]?)([0-9]\.[0-9]{1,3})?$)/;
  if (reg.test(s)) {
    return true;
  } else if (s == 0.00) {
    return false;
  } else if (s == 0.000) {
    return false;
  } else {
    return false;
  }
};

/**
    ----------------------------------- 手机号 -------------------------------------------
**/
//手机号
jQuery.validator.addMethod(
  "tel",
  function (value, element) {
    return this.optional(element) || x.chkTel(value);
  },
  $.validator.messages.tel
);
//检查手机号
x.chkTel = function (s) {
  if (x.regEx.Tel.test(s)) {
    return true;
  } else {
    return false;
  }
};

/**
    ----------------------------------- 邮箱 -------------------------------------------
**/
//邮箱
jQuery.validator.addMethod(
  "mail",
  function (value, element) {
    return this.optional(element) || x.chkEmail(value);
  },
  $.validator.messages.mail
);
//检查邮箱
x.chkEmail = function (s) {
  if (x.regEx.Email.test(s)) {
    return true;
  } else {
    return false;
  }
};

/**
    ----------------------------------- 固定电话 0755-12345678 -------------------------------------------
**/
//固定电话 0755-12345678
jQuery.validator.addMethod(
  "phone",
  function (value, element) {
    return this.optional(element) || x.chkMobile(value);
  },
  $.validator.messages.phone
);
//检查固定电话
x.chkMobile = function (s) {
  if (x.regEx.Mobile.test(s)) {
    return true;
  } else {
    return false;
  }
};

/**
    ----------------------------------- 固定电话 手机号码 0755-12345678或18612345678-------------------------------------------
**/
//固定电话 手机号码
jQuery.validator.addMethod(
  "telPhone",
  function (value, element) {
    return this.optional(element) || x.chkTelMobile(value);
  },
  $.validator.messages.telPhone
);
//检查固定电话 手机号码
x.chkTelMobile = function (s) {
  if (!x.chkMobile(s) && !x.chkTel(s)) {
    return false;
  } else {
    return true;
  }
};

/**
    ----------------------------------- 邮政编码 -------------------------------------------
**/
//邮政编码
jQuery.validator.addMethod(
  "postCode",
  function (value, element) {
    return this.optional(element) || x.chkPostCode(value);
  },
  $.validator.messages.postCode
);
//检查邮政编码
x.chkPostCode = function (s) {
  if (x.regEx.PostCode.test(s)) {
    return true;
  } else {
    return false;
  }
};

/**
    ----------------------------------- 身份证号 -------------------------------------------
**/
//身份证号
jQuery.validator.addMethod(
  "idcardSimple",
  function (value, element) {
    return this.optional(element) || x.chkCardId(value);
  },
  $.validator.messages.idcardSimple
);
//检查邮政编码
x.chkCardId = function (s) {
  if (x.regEx.CardId.test(s)) {
    return true;
  } else {
    return false;
  }
};

/**
    ----------------------------------- 中文 -------------------------------------------
**/
//中文
jQuery.validator.addMethod(
  "chineseWord",
  function (value, element) {
    return this.optional(element) || x.chkChineseWord(value);
  },
  $.validator.messages.chineseWord
);
//检查中文
x.chkChineseWord = function (s) {
  if (x.regEx.ChineseWord.test(s)) {
    return true;
  } else {
    return false;
  }
};

/**
    ----------------------------------- 英文 -------------------------------------------
**/
//英文
jQuery.validator.addMethod(
  "englishWord",
  function (value, element) {
    return this.optional(element) || x.chkEnglishWord(value);
  },
  $.validator.messages.englishWord
);
//检查英文
x.chkEnglishWord = function (s) {
  if (x.regEx.EnglishWord.test(s)) {
    return true;
  } else {
    return false;
  }
};

/**
    ----------------------------------- 特殊字符 -------------------------------------------
**/
//中文
jQuery.validator.addMethod(
  "specialWord",
  function (value, element) {
    return this.optional(element) || x.chkSpecialWord(value);
  },
  $.validator.messages.specialWord
);
//检查英文
x.chkSpecialWord = function (s) {
  if (x.regEx.SpecialWord.test(s)) {
    return true;
  } else {
    return false;
  }
};

/**
----------------------------------- 英文数字 -------------------------------------------
**/
jQuery.validator.addMethod(
  "enNum",
  function (value, element) {
    return this.optional(element) || x.chkNumEn(value);
  },
  $.validator.messages.enNum
);
//检查账户
x.chkNumEn = function (s) {
  if (x.regEx.NumEn.test(s)) {
    return true;
  } else {
    return false;
  }
};

/**
    ----------------------------------- 公司名称 中英文数字 -------------------------------------------
**/
//公司名称 中英文数字
jQuery.validator.addMethod(
  "chEnNum",
  function (value, element) {
    return this.optional(element) || x.chkChineseEnNum(value);
  },
  $.validator.messages.chEnNum
);
//检查公司名称 中英文数字
x.chkChineseEnNum = function (s) {
  if (x.regEx.ChineseEnNum.test(s)) {
    return true;
  } else {
    return false;
  }
};

/**
    ----------------------------------- 银行卡号 -------------------------------------------
**/
//银行卡号
jQuery.validator.addMethod(
  "bankCard",
  function (value, element) {
    return this.optional(element) || x.chkCardNum(value);
  },
  $.validator.messages.bankCard
);
//检查 银行卡号
x.chkCardNum = function (s) {
  if (x.regEx.CardNum.test(s)) {
    return true;
  } else {
    return false;
  }
};



/**
    ----------------------------------- 备注 非特殊字符 -------------------------------------------
**/
//备注 非特殊字符
jQuery.validator.addMethod(
  "str",
  function (value, element) {
    return this.optional(element) || x.chkStrs(value);
  },
  $.validator.messages.str
);
//检查 特殊字符
x.chkStrs = function (s) {
  if (x.regEx.Strs.test(s)) {
    return true;
  } else {
    return false;
  }
};

/**
    ----------------------------------- 国内车牌号 -------------------------------------------
**/
//国内车牌号
jQuery.validator.addMethod("carNo", function (value, element, params) {
  var checkPwd = /^[京津沪渝冀豫云辽黑湘皖鲁新苏浙赣鄂桂甘晋蒙陕吉闽贵粤青藏川宁琼使领A-Z]{1}[A-Z]{1}[A-Z0-9]{4}[A-Z0-9挂学警港澳]{1}$/;
  return this.optional(element) || (checkPwd.test(value));
}, $.validator.messages.carNo);



/**
    ----------------------------------- 不能输入设定值 -------------------------------------------
**/
// 不等于
jQuery.validator.addMethod(
  "notEqualTo",
  function (value, element, param) {
    return value != param;
  },
  $.validator.messages.notEqualTo
);

/**
    ----------------------------------- 两项必须填写一项  -------------------------------------------
**/
// 指定元素与此元素必须填写其中一项
jQuery.validator.addMethod(
  "requiredOne",
  function (value, element, param) {
    return value != "" || $(param).val() != "";
    // var v1 = $(param).val();
    // if (v1 == "" && value == "") {
    //   return value != "";
    // } else {
    //   return true;
    // }
  },
  $.validator.messages.requiredOne
);

/**
    ----------------------------------- 若指定元素为不为空则此元素也为必填  -------------------------------------------
**/
// 若指定元素为不为空则此元素也为必填
jQuery.validator.addMethod(
  "requiredTo",
  function (value, element, param) {
    var requiredTo = $(param).val();
    if (requiredTo != "") {
      return value != "";
    } else {
      return true;
    }
  },
  $.validator.messages.requiredTo
);

/**
    ----------------------------------- 验证值不允许与特定值等于  -------------------------------------------
**/
// 验证值不允许与特定值等于
jQuery.validator.addMethod(
  "notEquals",
  function (value, element, param) {
    return value != $(param).val();
  },
  $.validator.messages.notEquals
);

/**
    ----------------------------------- 此元素小于等于指定元素  -------------------------------------------
**/
//此元素小于等于指定元素
jQuery.validator.addMethod(
  "lessThan",
  function (value, element, param) {
    var otherValue = $(param).val();
    if (value - otherValue <= 0) {
      return true;
    } else {
      return false;
    }
  },
  $.validator.messages.lessThan
);

/**
    ----------------------------------- 时间格式验证  2011-07-07和2011/07/07 -------------------------------------------
**/
// 添加日期延至方法 验证 2011-07-07和2011/07/07两种短横线和斜杠格式
jQuery.validator.addMethod(
  "ymdDate",
  function (value, element) {
    var ereg = /^(\d{1,4})(-|\/)(\d{1,2})(-|\/)(\d{1,2})$/;
    var r = value.match(ereg);
    if (r == null) {
      return false;
    }
    var d = new Date(r[1], r[3] - 1, r[5]);
    var result =
      d.getFullYear() == r[1] &&
      d.getMonth() + 1 == r[3] &&
      d.getDate() == r[5];
    return this.optional(element) || result;
  },
  $.validator.messages.ymdDate
);

/**
    ----------------------------------- 以 00:00 23:59 时间格式 -------------------------------------------
**/

jQuery.validator.addMethod(
  "hmTime",
  function (value, element) {
    return (
      this.optional(element) || /^([01]\d|2[0-3])(:[0-5]\d){0,2}$/.test(value)
    );
  },
  $.validator.messages.hmTime
);

/**
    ----------------------------------- 比较数字大小验证  -------------------------------------------
**/
// 添加数字大小
jQuery.validator.addMethod(
  "compareInt",
  function (value, element, param) {
    var v1 = $(param).val();
    return v1 < value;
  },
  $.validator.messages.compareInt
);


/**
    ----------------------------------- 以 {0} 开头的字符串 -------------------------------------------
**/
jQuery.validator.addMethod(
  "prefix",
  function (value, element, param) {
    var prefix = new RegExp("^" + param);
    return this.optional(element) || prefix.test(value);
  },
  $.validator.messages.prefix
);


/**
    ----------------------------------- 不能超过{0}个字节(一个中文字算2个字节 -------------------------------------------
**/
jQuery.validator.addMethod(
  "byteMaxLength",
  function (value, element, param) {
    var length = value.length;
    for (var i = 0; i < value.length; i++) {
      if (value.charCodeAt(i) > 127) {
        length++;
      }
    }
    return this.optional(element) || length <= param;
  },
  $.validator.messages.byteMaxLength
);

/**
    ----------------------------------- 不能少于{0}个字节(一个中文字算2个字节 -------------------------------------------
**/
jQuery.validator.addMethod(
  "byteMinLength",
  function (value, element, param) {
    var length = value.length;
    for (var i = 0; i < value.length; i++) {
      if (value.charCodeAt(i) > 127) {
        length++;
      }
    }
    return this.optional(element) || length >= param;
  },
  $.validator.messages.byteMinLength
);

/**
    ----------------------------------- 区间内的字数计算 一个中文字算2个字节 -------------------------------------------
**/
jQuery.validator.addMethod(
  "byteRangeLength",
  function (value, element, param) {
    var length = value.length;
    for (var i = 0; i < value.length; i++) {
      if (value.charCodeAt(i) > 127) {
        length++;
      }
    }
    return this.optional(element) || (length >= param[0] && length <= param[1]);
  },
  $.validator.messages.byteRangeLength
);



/**
    ----------------------------------- 检查是否有敏感字眼 -------------------------------------------
    马勒戈壁|卧槽泥马|骚|淫|淫乱|婬蕩|嫖|A片|B毛翻|CAO你|FaLun|Falun|Fa轮|Fa仑|FaLundaFa|FaLun大Fa|G片|JB|e夜情|faL工|fa轮大法|lun功|屄|屌|澤民|爱液|安全套|按推油|按摩服务|包皮|包养|監控|監控暴动|暴政|北京政权|被捕|庇眼|避孕套|表子|勃起|不要脸|藏独|操你|操B|操逼|曹刚川|草你|草祢|策反|长春弟子|陈良宇|陈亚德|成人电影|成人卡通|成人网|成人影院|成人游戏|赤匪|赤化|处男|处女|传单|春药|催情药|催情|搓弄|达赖|打倒|打飞机|打炮|大逼|大法|大法子|大纪元|大炮|大J|大陆当局|大屠杀|带套|祼|党棍|党国|荡妇|荡女|盗卖器官|邓小平|抵制日货|颠覆|电击痕|叼|调情|碟片|动乱|对射|发论|发论工|发伦工|发论工|法lun功|法功|法轮|法輪|法轮功|反攻大陆|反共|方励之|放弃信仰|放纵|封锁消息|夫妻秀|肛|肛交|高潮|高丽|搞~你妈|共产|共党|共和国|共產党|共匪|共军|关根|官正|光光|龟头|郭伯雄|捍东|贺国强|贺領征|嘿咻|嘿咻|黑道口令|洪星|洪志|红色恐怖|红杏|后宫电影院|胡锦涛|胡泽君|胡紧掏|黄华华|黄菊|黄龙云|黄片|黄色电影|回良玉|活体器官|活体摘取|激聊|激情|鸡吧|鸡巴|鸡八|鸡巴|鸡鸡|鸡婆|妓院|家宝|贾庆林|假抗日真扩充|监控电脑|监视监听|间谍|间谍偷窥|简金莲|贱货|贱种|贱种健行|见面做|江主席|江集团|江井恒|江井康|江青|江氏集团|疆独|交换夫妻|叫床|叫鸡|金瓶梅|金枪不倒|锦涛|晋三|精灵下载|精液|精子|静坐|九评|巨乳|绝食|看片激情|口技|口交|口技|口交|口淫|酷刑|狂巢|狂干|狂刷|烂货|烂污|烂种|浪叫|老虎凳|李长春|李鸿忠|李克强|李源潮|李长春|李鹏|李岚清|里藏春|恋童|炼功|梁伟发|两个中国|两腿胯间|聊性|林雄|刘玉浦|刘云山|刘淇|六四|六五|六4|陆肆|吕秀莲|卵泡|乱伦|轮尖|轮奸|罗干|裸聊|裸干|裸聊|裸体|裸图|裸照|妈爽|妈逼|妈操|妈个B|马英九|肏你妈|毛片|美女全脱|蒙汗药|猛进猛出|迷药|民主|民运|明慧|奶子|男主|女主|虐恋|叛乱|陪聊|喷精|器官移植|强卫|强暴|悄悄话查看|翘屁股|情人|情趣用品|庆红|庆林|全程激情|全裸|群发短信|群交|让燥|人尽可夫|日您|日你|容基|肉棒|肉洞|肉棍|肉蒲团|肉穴|乳房|软时|瑞环|三去车仑功|三去-车仑-功|骚|骚妇|骚女|骚货|骚穴|骚液|色狐|色虎|色库|色情|色域|傻b|煞笔|上床|上我|绍基|射精|生殖|实战|示威|视聊|视频|视频收费|视频语聊|视看|视频看|视频聊|收费视频|首都广场|瘦大|兽交|帅哥按摩|爽片|水扁|丝袜|死全家|宋楚瑜|苏家屯|台独|太子党|天安门|天符|添服|添屁眼|舔|舔你|舔私|铁映|同志碟|同志蝶|同志片|偷窺|偷窥|推拿推油|推油推拿|腿毛多|退党|脱衣|玩女人|王兆国|王岐山|王珉|亡党|伟哥|魏星艳|温家宝|我日|我燥|无帮国|吾尔开希|吴邦国|吴官正|吴仪|吴邦国|吴官正|五四运动|务动奖|吸精|习近平|下面特大|下阴|下面大|下面粗大|下体|小平|小肉缝|小穴|肖志恒|辛荣国|新唐人|性爱|性电影|性视频|性爱|性病|性福|性关系|性狐|性交|性奴|性趣|徐少华|悬赏|学潮|学联|学聊|学运|血逼|血洗|血比|血洗|延时药|颜色革命|阳具|一夜|一党专政|一夜情|一中一台|壹夜情|荫道|阴部|阴唇|阴道|阴茎|阴蒂|阴核|阴毛|游行|俞正声|语视|语聊|语音做|欲火|杂种|在家寂寞|泽东|泽民|曾培炎|曾庆红|包夜
**/

function filter() {
  //关键词过滤
  var filter_str = unescape(
    "%u9A6C%u52D2%u6208%u58C1%7C%u5367%u69FD%u6CE5%u9A6C%7C%u9A9A%7C%u6DEB%7C%u6DEB%u4E71%7C%u5A6C%u8569%7C%u5AD6%7CA%u7247%7CB%u6BDB%u7FFB%7CCAO%u4F60%7CFaLun%7CFalun%7CFa%u8F6E%7CFa%u4ED1%7CFaLundaFa%7CFaLun%u5927Fa%7CG%u7247%7CJB%7Ce%u591C%u60C5%7CfaL%u5DE5%7Cfa%u8F6E%u5927%u6CD5%7Clun%u529F%7C%u5C44%7C%u5C4C%7C%u6FA4%u6C11%7C%u7231%u6DB2%7C%u5B89%u5168%u5957%7C%u6309%u63A8%u6CB9%7C%u6309%u6469%u670D%u52A1%7C%u5305%u76AE%7C%u5305%u517B%7C%u76E3%u63A7%7C%u76E3%u63A7%u66B4%u52A8%7C%u66B4%u653F%7C%u5317%u4EAC%u653F%u6743%7C%u88AB%u6355%7C%u5E87%u773C%7C%u907F%u5B55%u5957%7C%u8868%u5B50%7C%u52C3%u8D77%7C%u4E0D%u8981%u8138%7C%u85CF%u72EC%7C%u64CD%u4F60%7C%u64CDB%7C%u64CD%u903C%7C%u66F9%u521A%u5DDD%7C%u8349%u4F60%7C%u8349%u7962%7C%u7B56%u53CD%7C%u957F%u6625%u5F1F%u5B50%7C%u9648%u826F%u5B87%7C%u9648%u4E9A%u5FB7%7C%u6210%u4EBA%u7535%u5F71%7C%u6210%u4EBA%u5361%u901A%7C%u6210%u4EBA%u7F51%7C%u6210%u4EBA%u5F71%u9662%7C%u6210%u4EBA%u6E38%u620F%7C%u8D64%u532A%7C%u8D64%u5316%7C%u5904%u7537%7C%u5904%u5973%7C%u4F20%u5355%7C%u6625%u836F%7C%u50AC%u60C5%u836F%7C%u50AC%u60C5%7C%u6413%u5F04%7C%u8FBE%u8D56%7C%u6253%u5012%7C%u6253%u98DE%u673A%7C%u6253%u70AE%7C%u5927%u903C%7C%u5927%u6CD5%7C%u5927%u6CD5%u5B50%7C%u5927%u7EAA%u5143%7C%u5927%u70AE%7C%u5927J%7C%u5927%u9646%u5F53%u5C40%7C%u5927%u5C60%u6740%7C%u5E26%u5957%7C%u797C%7C%u515A%u68CD%7C%u515A%u56FD%7C%u8361%u5987%7C%u8361%u5973%7C%u76D7%u5356%u5668%u5B98%7C%u9093%u5C0F%u5E73%7C%u62B5%u5236%u65E5%u8D27%7C%u98A0%u8986%7C%u7535%u51FB%u75D5%7C%u53FC%7C%u8C03%u60C5%7C%u789F%u7247%7C%u52A8%u4E71%7C%u5BF9%u5C04%7C%u53D1%u8BBA%7C%u53D1%u8BBA%u5DE5%7C%u53D1%u4F26%u5DE5%7C%u53D1%u8BBA%u5DE5%7C%u6CD5lun%u529F%7C%u6CD5%u529F%7C%u6CD5%u8F6E%7C%u6CD5%u8F2A%7C%u6CD5%u8F6E%u529F%7C%u53CD%u653B%u5927%u9646%7C%u53CD%u5171%7C%u65B9%u52B1%u4E4B%7C%u653E%u5F03%u4FE1%u4EF0%7C%u653E%u7EB5%7C%u5C01%u9501%u6D88%u606F%7C%u592B%u59BB%u79C0%7C%u809B%7C%u809B%u4EA4%7C%u9AD8%u6F6E%7C%u9AD8%u4E3D%7C%u641E%7E%u4F60%u5988%7C%u5171%u4EA7%7C%u5171%u515A%7C%u5171%u548C%u56FD%7C%u5171%u7522%u515A%7C%u5171%u532A%7C%u5171%u519B%7C%u5173%u6839%7C%u5B98%u6B63%7C%u5149%u5149%7C%u9F9F%u5934%7C%u90ED%u4F2F%u96C4%7C%u634D%u4E1C%7C%u8D3A%u56FD%u5F3A%7C%u8D3A%u9818%u5F81%7C%u563F%u54BB%7C%u563F%u54BB%7C%u9ED1%u9053%u53E3%u4EE4%7C%u6D2A%u661F%7C%u6D2A%u5FD7%7C%u7EA2%u8272%u6050%u6016%7C%u7EA2%u674F%7C%u540E%u5BAB%u7535%u5F71%u9662%7C%u80E1%u9526%u6D9B%7C%u80E1%u6CFD%u541B%7C%u80E1%u7D27%u638F%7C%u9EC4%u534E%u534E%7C%u9EC4%u83CA%7C%u9EC4%u9F99%u4E91%7C%u9EC4%u7247%7C%u9EC4%u8272%u7535%u5F71%7C%u56DE%u826F%u7389%7C%u6D3B%u4F53%u5668%u5B98%7C%u6D3B%u4F53%u6458%u53D6%7C%u6FC0%u804A%7C%u6FC0%u60C5%7C%u9E21%u5427%7C%u9E21%u5DF4%7C%u9E21%u516B%7C%u9E21%u5DF4%7C%u9E21%u9E21%7C%u9E21%u5A46%7C%u5993%u9662%7C%u5BB6%u5B9D%7C%u8D3E%u5E86%u6797%7C%u5047%u6297%u65E5%u771F%u6269%u5145%7C%u76D1%u63A7%u7535%u8111%7C%u76D1%u89C6%u76D1%u542C%7C%u95F4%u8C0D%7C%u95F4%u8C0D%u5077%u7AA5%7C%u7B80%u91D1%u83B2%7C%u8D31%u8D27%7C%u8D31%u79CD%7C%u8D31%u79CD%u5065%u884C%7C%u89C1%u9762%u505A%7C%u6C5F%u4E3B%u5E2D%7C%u6C5F%u96C6%u56E2%7C%u6C5F%u4E95%u6052%7C%u6C5F%u4E95%u5EB7%7C%u6C5F%u9752%7C%u6C5F%u6C0F%u96C6%u56E2%7C%u7586%u72EC%7C%u4EA4%u6362%u592B%u59BB%7C%u53EB%u5E8A%7C%u53EB%u9E21%7C%u91D1%u74F6%u6885%7C%u91D1%u67AA%u4E0D%u5012%7C%u9526%u6D9B%7C%u664B%u4E09%7C%u7CBE%u7075%u4E0B%u8F7D%7C%u7CBE%u6DB2%7C%u7CBE%u5B50%7C%u9759%u5750%7C%u4E5D%u8BC4%7C%u5DE8%u4E73%7C%u7EDD%u98DF%7C%u770B%u7247%u6FC0%u60C5%7C%u53E3%u6280%7C%u53E3%u4EA4%7C%u53E3%u6280%7C%u53E3%u4EA4%7C%u53E3%u6DEB%7C%u9177%u5211%7C%u72C2%u5DE2%7C%u72C2%u5E72%7C%u72C2%u5237%7C%u70C2%u8D27%7C%u70C2%u6C61%7C%u70C2%u79CD%7C%u6D6A%u53EB%7C%u8001%u864E%u51F3%7C%u674E%u957F%u6625%7C%u674E%u9E3F%u5FE0%7C%u674E%u514B%u5F3A%7C%u674E%u6E90%u6F6E%7C%u674E%u957F%u6625%7C%u674E%u9E4F%7C%u674E%u5C9A%u6E05%7C%u91CC%u85CF%u6625%7C%u604B%u7AE5%7C%u70BC%u529F%7C%u6881%u4F1F%u53D1%7C%u4E24%u4E2A%u4E2D%u56FD%7C%u4E24%u817F%u80EF%u95F4%7C%u804A%u6027%7C%u6797%u96C4%7C%u5218%u7389%u6D66%7C%u5218%u4E91%u5C71%7C%u5218%u6DC7%7C%u516D%u56DB%7C%u516D%u4E94%7C%u516D4%7C%u9646%u8086%7C%u5415%u79C0%u83B2%7C%u5375%u6CE1%7C%u4E71%u4F26%7C%u8F6E%u5C16%7C%u8F6E%u5978%7C%u7F57%u5E72%7C%u88F8%u804A%7C%u88F8%u5E72%7C%u88F8%u804A%7C%u88F8%u4F53%7C%u88F8%u56FE%7C%u88F8%u7167%7C%u5988%u723D%7C%u5988%u903C%7C%u5988%u64CD%7C%u5988%u4E2AB%7C%u9A6C%u82F1%u4E5D%7C%u808F%u4F60%u5988%7C%u6BDB%u7247%7C%u7F8E%u5973%u5168%u8131%7C%u8499%u6C57%u836F%7C%u731B%u8FDB%u731B%u51FA%7C%u8FF7%u836F%7C%u6C11%u4E3B%7C%u6C11%u8FD0%7C%u660E%u6167%7C%u5976%u5B50%7C%u7537%u4E3B%7C%u5973%u4E3B%7C%u8650%u604B%7C%u53DB%u4E71%7C%u966A%u804A%7C%u55B7%u7CBE%7C%u5668%u5B98%u79FB%u690D%7C%u5F3A%u536B%7C%u5F3A%u66B4%7C%u6084%u6084%u8BDD%u67E5%u770B%7C%u7FD8%u5C41%u80A1%7C%u60C5%u4EBA%7C%u60C5%u8DA3%u7528%u54C1%7C%u5E86%u7EA2%7C%u5E86%u6797%7C%u5168%u7A0B%u6FC0%u60C5%7C%u5168%u88F8%7C%u7FA4%u53D1%u77ED%u4FE1%7C%u7FA4%u4EA4%7C%u8BA9%u71E5%7C%u4EBA%u5C3D%u53EF%u592B%7C%u65E5%u60A8%7C%u65E5%u4F60%7C%u5BB9%u57FA%7C%u8089%u68D2%7C%u8089%u6D1E%7C%u8089%u68CD%7C%u8089%u84B2%u56E2%7C%u8089%u7A74%7C%u4E73%u623F%7C%u8F6F%u65F6%7C%u745E%u73AF%7C%u4E09%u53BB%u8F66%u4ED1%u529F%7C%u4E09%u53BB-%u8F66%u4ED1-%u529F%7C%u9A9A%7C%u9A9A%u5987%7C%u9A9A%u5973%7C%u9A9A%u8D27%7C%u9A9A%u7A74%7C%u9A9A%u6DB2%7C%u8272%u72D0%7C%u8272%u864E%7C%u8272%u5E93%7C%u8272%u60C5%7C%u8272%u57DF%7C%u50BBb%7C%u715E%u7B14%7C%u4E0A%u5E8A%7C%u4E0A%u6211%7C%u7ECD%u57FA%7C%u5C04%u7CBE%7C%u751F%u6B96%7C%u5B9E%u6218%7C%u793A%u5A01%7C%u89C6%u804A%7C%u89C6%u9891%7C%u89C6%u9891%u6536%u8D39%7C%u89C6%u9891%u8BED%u804A%7C%u89C6%u770B%7C%u89C6%u9891%u770B%7C%u89C6%u9891%u804A%7C%u6536%u8D39%u89C6%u9891%7C%u9996%u90FD%u5E7F%u573A%7C%u7626%u5927%7C%u517D%u4EA4%7C%u5E05%u54E5%u6309%u6469%7C%u723D%u7247%7C%u6C34%u6241%7C%u4E1D%u889C%7C%u6B7B%u5168%u5BB6%7C%u5B8B%u695A%u745C%7C%u82CF%u5BB6%u5C6F%7C%u53F0%u72EC%7C%u592A%u5B50%u515A%7C%u5929%u5B89%u95E8%7C%u5929%u7B26%7C%u6DFB%u670D%7C%u6DFB%u5C41%u773C%7C%u8214%7C%u8214%u4F60%7C%u8214%u79C1%7C%u94C1%u6620%7C%u540C%u5FD7%u789F%7C%u540C%u5FD7%u8776%7C%u540C%u5FD7%u7247%7C%u5077%u7ABA%7C%u5077%u7AA5%7C%u63A8%u62FF%u63A8%u6CB9%7C%u63A8%u6CB9%u63A8%u62FF%7C%u817F%u6BDB%u591A%7C%u9000%u515A%7C%u8131%u8863%7C%u73A9%u5973%u4EBA%7C%u738B%u5146%u56FD%7C%u738B%u5C90%u5C71%7C%u738B%u73C9%7C%u4EA1%u515A%7C%u4F1F%u54E5%7C%u9B4F%u661F%u8273%7C%u6E29%u5BB6%u5B9D%7C%u6211%u65E5%7C%u6211%u71E5%7C%u65E0%u5E2E%u56FD%7C%u543E%u5C14%u5F00%u5E0C%7C%u5434%u90A6%u56FD%7C%u5434%u5B98%u6B63%7C%u5434%u4EEA%7C%u5434%u90A6%u56FD%7C%u5434%u5B98%u6B63%7C%u4E94%u56DB%u8FD0%u52A8%7C%u52A1%u52A8%u5956%7C%u5438%u7CBE%7C%u4E60%u8FD1%u5E73%7C%u4E0B%u9762%u7279%u5927%7C%u4E0B%u9634%7C%u4E0B%u9762%u5927%7C%u4E0B%u9762%u7C97%u5927%7C%u4E0B%u4F53%7C%u5C0F%u5E73%7C%u5C0F%u8089%u7F1D%7C%u5C0F%u7A74%7C%u8096%u5FD7%u6052%7C%u8F9B%u8363%u56FD%7C%u65B0%u5510%u4EBA%7C%u6027%u7231%7C%u6027%u7535%u5F71%7C%u6027%u89C6%u9891%7C%u6027%u7231%7C%u6027%u75C5%7C%u6027%u798F%7C%u6027%u5173%u7CFB%7C%u6027%u72D0%7C%u6027%u4EA4%7C%u6027%u5974%7C%u6027%u8DA3%7C%u5F90%u5C11%u534E%7C%u60AC%u8D4F%7C%u5B66%u6F6E%7C%u5B66%u8054%7C%u5B66%u804A%7C%u5B66%u8FD0%7C%u8840%u903C%7C%u8840%u6D17%7C%u8840%u6BD4%7C%u8840%u6D17%7C%u5EF6%u65F6%u836F%7C%u989C%u8272%u9769%u547D%7C%u9633%u5177%7C%u4E00%u591C%7C%u4E00%u515A%u4E13%u653F%7C%u4E00%u591C%u60C5%7C%u4E00%u4E2D%u4E00%u53F0%7C%u58F9%u591C%u60C5%7C%u836B%u9053%7C%u9634%u90E8%7C%u9634%u5507%7C%u9634%u9053%7C%u9634%u830E%7C%u9634%u8482%7C%u9634%u6838%7C%u9634%u6BDB%7C%u6E38%u884C%7C%u4FDE%u6B63%u58F0%7C%u8BED%u89C6%7C%u8BED%u804A%7C%u8BED%u97F3%u505A%7C%u6B32%u706B%7C%u6742%u79CD%7C%u5728%u5BB6%u5BC2%u5BDE%7C%u6CFD%u4E1C%7C%u6CFD%u6C11%7C%u66FE%u57F9%u708E%7C%u66FE%u5E86%u7EA2%7C%u5305%u591C"
  );
  return new RegExp(filter_str, "gi");
}
jQuery.validator.addMethod(
  "filt",
  function (value, element) {
    return value.match(filter()) == null;
  },
  function (value, element) {
    var m = element.value.match(filter());
    var keys = m[0];
    for (var i = 1; i < m.length; i++) {
      keys += ", " + m[i];
    }
    return "不能填写敏感词";
    // return "出现敏感字-" + keys;
  }
);

/**
  ----------------------------------- 勿输入空格 -------------------------------------------
**/
jQuery.validator.addMethod(
  "space",
  function (value, element) {
    return value.indexOf(" ") < 0 && value != "";
  },
  $.validator.messages.space
);

/**
----------------------------------- 数字大小对比 -------------------------------------------
**/
jQuery.validator.addMethod("isSize", function(value, element, param) {
  return this.optional(element) || x.chkSize(value, param);
}, "收缩压必须大于舒张压");
x.chkSize=function(value, param){
var sNum=$(param).val();
if(Number(sNum)<Number(value)){
  return true;
}else{
  return false;
}
};

//1位小数点
jQuery.validator.addMethod("isDecimal", function(value, element) {
	return this.optional(element) || x.chkDecimal(value);
}, "只能输入1位小数");
//检查数字 和 小数的后1位
x.chkDecimal=function (s){
	if(x.regEx.Sum.test(s)){
		return true;
	}else{
		return false;
	}
};